Device Execute CLI

Device Execute CLI runs a specified command on one or more devices.

The following example shows the output of a device execute CLI which runs the show run int eth 0/5 command:

(efa:root)root@ubuntu:~# efa inventory device execute-cli --command "show run int eth 0/5-6"  --ip 10.20.48.161

Execute CLI[success]
+--------------+-----------+--------+------------------------+---------+--------+-------------------------------+
|  IP Address  | Host Name | Fabric |        Command         | Status  | Reason |            Output             |
+--------------+-----------+--------+------------------------+---------+--------+-------------------------------+
| 10.20.48.161 | leaf1     | fs     | show run int eth 0/5-6 | Success |        | leaf1# show run int eth 0/5-6 |
|              |           |        |                        |         |        | interface Ethernet 0/5        |
|              |           |        |                        |         |        |  no shutdown                  |
|              |           |        |                        |         |        | !                             |
|              |           |        |                        |         |        | interface Ethernet 0/6        |
|              |           |        |                        |         |        |  no shutdown                  |
|              |           |        |                        |         |        | !                             |
|              |           |        |                        |         |        |                               |
+--------------+-----------+--------+------------------------+---------+--------+-------------------------------+
Execute CLI Details
--- Time Elapsed: 6.27803233s ---

Using fabric option, you can use the execute CLI to run a specified command on all the devices of a fabric.

(efa:root)root@ubuntu:~# efa inventory device execute-cli --command "show run int eth 0/5"  --fabric fs
Execute CLI[success]
+--------------+-----------+--------+----------------------+---------+--------+-----------------------------+
|  IP Address  | Host Name | Fabric |       Command        | Status  | Reason |           Output            |
+--------------+-----------+--------+----------------------+---------+--------+-----------------------------+
| 10.20.48.161 | leaf1     | fs     | show run int eth 0/5 | Success |        | leaf1# show run int eth 0/5 |
|              |           |        |                      |         |        | interface Ethernet 0/5      |
|              |           |        |                      |         |        |  no shutdown                |
|              |           |        |                      |         |        | !                           |
|              |           |        |                      |         |        |                             |
+--------------+-----------+--------+----------------------+---------+--------+-----------------------------+
| 10.20.48.162 | leaf2     | fs     | show run int eth 0/5 | Success |        | leaf2# show run int eth 0/5 |
|              |           |        |                      |         |        | interface Ethernet 0/5      |
|              |           |        |                      |         |        |  no shutdown                |
|              |           |        |                      |         |        | !                           |
|              |           |        |                      |         |        |                             |
+--------------+-----------+--------+----------------------+---------+--------+-----------------------------+
Execute CLI Details
--- Time Elapsed: 5.132525111s ---